//
//  TimePicker.m
//  FootPrint
//
//  Created by alex tao on 4/7/13.
//  Copyright (c) 2013 alex tao. All rights reserved.
//

#import "TimePicker.h"

@implementation TimePicker

- (void)internalInit
{
    [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:self options:nil];
    
    _contentView.frame = self.bounds;
    [self addSubview:_contentView];
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {
        // Initialization code
        [self internalInit];
    }
    return self;
}

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        [self internalInit];
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

- (void)dealloc {
    [_pickBlock release];
    [_contentView release];
    [_picker release];
    [super dealloc];
}

- (IBAction)selectDate:(id)sender {
    _pickBlock(_picker.date);
    [self removeFromSuperview];
}

- (IBAction)selectCancel:(id)sender {
    [self removeFromSuperview];
}

@end
